import pygame
from pygame.locals import *
from sys import exit

image_filename = 'pygame.jpg'

pygame.init()
screen = pygame.display.set_mode((400, 300), 0, 32)
pygame.display.set_caption("Moving Image")
img = pygame.image.load(image_filename)
x = 0
while True:
    screen.fill((255, 255, 255))
    for event in pygame.event.get():
        if event.type == QUIT:
            exit()
    screen.blit(img, (x, 100))
    x = x + 0.05

    if x > 400:
        x = x - 400
    pygame.display.update()
